#ifndef QCOLOR_H
#define QCOLOR_H

#include "QOsBase.h"
#include "cx_typedef.h"
#include "PlatformConfig.h"

#define KQRgbBlack		     CQColor(0x000000)
#define KQRgbDarkGray	     CQColor(0x555555)
#define KQRgbDarkRed		 CQColor(0x000080)
#define KQRgbDarkGreen	     CQColor(0x008000)
#define KQRgbDarkYellow	     CQColor(0x008080)
#define KQRgbDarkBlue	     CQColor(0x800000)
#define KQRgbDarkMagenta	 CQColor(0x800080)
#define KQRgbDarkCyan	     CQColor(0x808000)
#define KQRgbRed			 CQColor(0x0000ff)
#define KQRgbGreen		     CQColor(0x00ff00)
#define KQRgbYellow		     CQColor(0x00ffff)
#define KQRgbBlue		     CQColor(0xff0000)
#define KQRgbMagenta		 CQColor(0xff00ff)
#define KQRgbCyan		     CQColor(0xffff00)
#define KQRgbGray		     CQColor(0xaaaaaa)
#define KQRgbWhite		     CQColor(0xffffff)
#define KQRgbGolden		     CQColor(0x1191f3)
#define KQFontBlue		     CQColor(0xedd27f)


class CQColor
{
public:
    IMPORT_C CQColor();
    IMPORT_C CQColor(QUINT32 aColor);
    IMPORT_C CQColor(const CQColor& aColor);
    IMPORT_C CQColor(CQColor& aColor);
    IMPORT_C CQColor(QUINT8 aRed, QUINT8 aGreen, QUINT8 aBlue, QUINT8 aAlpha=0);
    IMPORT_C CQColor(QUINT32 aInternalValue, QUINT8 aAlpha);
    IMPORT_C virtual ~CQColor();
    IMPORT_C void SetRed(QUINT8 aRed);
    IMPORT_C void SetGreen(QUINT8 aGreen);
    IMPORT_C void SetBlue(QUINT8 aBlue);
    IMPORT_C void SetAlpha(QUINT8 aAlpha);
    IMPORT_C QUINT32 Value() const;
    IMPORT_C CQColor& operator=(const CQColor& aColor);
    IMPORT_C QBOOL operator==(const CQColor& aColor);
    IMPORT_C CQColor& operator+( const CQColor& aColor );
    IMPORT_C CQColor& operator-( const CQColor& aColor );
    inline QUINT8 Red() const;
    inline QUINT8 Green() const;
    inline QUINT8 Blue() const;
    inline QUINT8 Alpha() const;

private:
    QUINT8 m_Red;
    QUINT8 m_Blue;
    QUINT8 m_Green;
    QUINT8 m_Alpha;

};

inline QUINT8 CQColor::Red() const
{
    return m_Red;
}

inline QUINT8 CQColor::Green() const
{
    return m_Green;
}

inline QUINT8 CQColor::Blue() const
{
    return m_Blue;
}

inline QUINT8 CQColor::Alpha() const
{
    return m_Alpha;
}

#endif //QCOLOR_H
